import {Component} from '@angular/core';
import {SlideTextComponent} from "../../components/slide-text/slide-text.component";
import {PageBoxComponent} from "../../components/page-box/page-box.component";
import {IndexPart1Component} from "../../components/index-part1/index-part1.component";
import {LineGradientBoxComponent} from "../../components/line-gradient-box/line-gradient-box.component";
import {GrayBoxComponent} from "../../components/gray-box/gray-box.component";
import {ContactUsComponent} from "../../components/contact-us/contact-us.component";
import {Grid75Component} from "../../components/grid-7-5/grid-7-5.component";
import {GlobalService} from "../../services/global.service";

@Component({
  selector: 'app-index',
  standalone: true,
  imports: [
    SlideTextComponent,
    PageBoxComponent,
    IndexPart1Component,
    LineGradientBoxComponent,
    GrayBoxComponent,
    ContactUsComponent,
    Grid75Component
  ],
  templateUrl: './index.component.html',
  styleUrl: './index.component.scss'
})
export class IndexComponent {

  ngAfterViewInit(): any {
    setTimeout(() => {
      const mySwiper = new Swiper('.swiper', {
        loop: true, // 循环模式选项
        autoplay: {
          delay: 5000,//5秒切换一次
        },//可选选项，自动滑动
        // 如果需要分页器
        pagination: {
          el: '.swiper-pagination',
          clickable: true,
          renderBullet: function (index: any, className: any) {
            return '<span class="' + className + '"></span>';
          },
        },
        // 如果需要前进后退按钮
        navigation: {
          nextEl: '.swiper-button-next',
          prevEl: '.swiper-button-prev',
        },

      })
    });
  }

  protected readonly GlobalService = GlobalService;
}
